
{% extends "templates/web.html" %}

{% block breadcrumbs %}
	{% include "templates/includes/breadcrumbs.html" %}
{% endblock %}

{% block header %}
<h1>{{ title }}</h1>
{% endblock %}

{% block page_content %}
	{% set today = frappe.utils.getdate(frappe.utils.nowdate()) %}
	<div class="row transaction-subheading">
	    <div class="col-xs-6">
	        <span class="indicator
				{% if frappe.utils.getdate(doc.admission_end_date) == today %}
					red"> Application will be closed soon
				{% elif frappe.utils.getdate(doc.admission_end_date) > today >= frappe.utils.getdate(doc.admission_start_date)%}
					green"> Application open
				{% elif frappe.utils.getdate(doc.admission_start_date) > today %}
					blue"> Application will open
				{% else %}
					darkgrey
				{% endif  %}
	        </span>
		</div>
	    <div class="col-xs-6 text-muted text-right small">
	        {{ _("Start on") }}: {{ frappe.format_date(admission_start_date) }}<br>
	        {{ _("End on") }}: {{ frappe.format_date(admission_end_date) }}
	    </div>
	</div><br>

	{%- if introduction -%}
		<div>{{ introduction }}</div>
	{% endif %}

	{% if program_details %}
		<br>
		<div class="table-responsive">
			<h3 class="bold">Eligibility and Other Details:</h3>
			<table class="table table-bordered table-hover">
				<thead>
					<tr class="active">
						<th style="width: 90px">Program/Std.</th>
						<th style="width: 170px">Minumum Age(DOB)</th>
						<th style="width: 170px">Maximum Age(DOB)</th>
						<th style="width: 100px">Application Fee</th>
					</tr>
				</thead>
				<tbody>
					{% for row in program_details %}
						<tr>
							<td>{{ row.program }}</td>
							<td>{{ row.minimum_age }}</td>
							<td>{{ row.maximum_age }}</td>
							<td>{{ row.application_fee }}</td>
						</tr>
					{% endfor %}
				</tbody>
			</table>
		</div>
	{% endif %}

	{%- if application_form_route -%}
		<br>
		<p>
			<a class='btn btn-primary'
			href='/{{ doc.application_form_route }}?new=1'>
			{{ _("Apply Now") }}</a>
		</p>
	{% endif %}

{% endblock %}
